/*
 *  Arrow
 *
 *  Created by David Giovannini on 1/5/07.
 *  Copyright 2007 Software by Jove. All rights reserved.
 *
 */
 
#include "SBJ/Interfaces/ExceptionCounter.h"

namespace SBJ
{

ExceptionCounter::ExceptionCounter( void )
: m_exceptions( 0 )
{
}

int
ExceptionCounter::getExceptionCount( void ) const
{
	boost::mutex::scoped_lock lock( m_guard );
	return m_exceptions;
}
	
void
ExceptionCounter::onException( const std::exception& exception, const std::string& context )
{
	boost::mutex::scoped_lock lock( m_guard );
	++m_exceptions;
	onExceptionSelf( exception, context );
}

}
